1. Field of The Invention
This invention relates to the field of font formats.
2. Background Art
When words or text are printed or displayed on a computer display, it is desirable for the application to be capable of accessing and utilizing all fonts stored within the computer system regardless of their format. The developer may want to use a particular font or perform a font specific feature that requires access to formatting details of the font. The current methods of accessing multiple font formats are architecture or platform dependent and do not provide enough flexibility for programmers that desire to fully utilize font specific features. A background of fonts and object oriented systems, along with a description of the disadvantages of prior art font accessibility, is described below.
Fonts
When words or text are displayed on a computer display or printed, it is often desirable to display or print the textual characters with varying designs, styles, and characteristics. For example, textual characters may have a design or format that the user feels is visually appealing. The particular design may be unique or consistent through a set of characters. In addition, the characters may have a specified obliqueness (degree of slant) and stroke weight (thickness of line). A set of characters that has a specific obliqueness, stroke weight, and a named design is referred to as a typeface (e.g., Courier, Helvetica, or Times). Multiple typefaces with a related or similar pattern or design are referred to as a family of typefaces (e.g., Courier, Courier Bold, Courier Oblique, and Courier Bold Oblique are in the same family of typefaces, Courier).
A typeface of a specific size (e.g., 10-point Courier) is referred to as a font. So while a typeface defines the design of the characters, the font defines the set of all characters in the typeface with a specific size and weight.
Another way to define a font is in terms of characters and glyphs. A character is a symbol that represents items like letters and numbers in a given writing system, for example, lowercase "g". When a given character is drawn, a shape now represents this character. This shape is called a glyph.
Each glyph must be mapped to a particular character for further use. Character encoding consists of a conversion table that maps the characters to glyph codes. A font is a collection of mapped glyphs and may have many faces, e.g., heavy, medium, oblique, gothic, and regular. In addition, all of these faces have a similar typographic design.
Outline Fonts and Bitmap Fonts
The physical appearance of a font (the glyph or typeface) is commonly created from two (2) methods. A font may be created from a mathematical formula that produces an outline for the characters, referred to as an outline font, or it may be created from a particular arrangement or pattern of dots, referred to as a bitmap font. The mathematical formulas of an outline font produce a series of lines and curves that are used to define the shape of each character to be printed. Because the characters are defined mathematically, they may be scaled to different sizes easily. However, when a character is scaled, the scaled outline may not properly align with the pixels on the display device. Consequently, the definitions of the outline font often adjust the outline or the illuminated pixels to generate a more visually appealing character. Unlike outline fonts, to obtain a larger or smaller size of a particular bitmap font, the bitmap font must be defined separately. Consequently, outline fonts are used more frequently than bitmap fonts.
Outline fonts may be defined in a multiplicity of different formats. Two common outline font formats are TrueType (developed by Apple and enhanced by Microsoft and Apple) and PostScript Type 1 (PostScript) (developed by Adobe Systems). A common objective in font use is for the text to appear on the display screen as close as possible to the text as it is printed; referred to as WYSIWYG (What You See Is What You Get) technology. To provide accurate WYSIWYG technology, a TrueType font definition contains different pixel adjustment (to match the outline to the pixels) than other font formats. In addition, each TrueType font (e.g., Helvetica Bold or Courier Bold Italic) is stored in a separate file in memory. The operating system then uses the stored files to generate, display, and print the font when necessary. To add an additional TrueType font, the developer or user merely needs to add the font file to the appropriate storage location.
A PostScript font is defined by a PostScript page-description language (PDL) that controls page layout and loads and scales outline fonts. The PDL is a logical programming language that provides for fonts and type sizes but leaves the printing and displaying of the font to the output device (i.e., printer or monitor). The PDL provides for scaling and accurate WYSIWYG output.
Due to the flexibility in both TrueType and PostScript font technology, these two font formats are commonly used. However, because they are formatted differently, a developer may not be able to use both formats simultaneously and efficiently without extensive problems and programming.
A developer may desire to display and use multiple fonts and font formats. Existing technology does not provide a platform independent effective manner for utilizing multiple font formats. One system used to access multiple font formats was produced by Apple Computer. The system consists of a Component Manager architecture and various font engines or components. When the developer desires to render a font, the application programming interface (API) accesses the component that performs the rendering.
Another prior art method is implemented in an object oriented system and utilizes Java.TM. (Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries), a computer programming language that is robust and may be utilized across multiple platforms. To fully understand the invention, it is useful to briefly discuss the Java.TM. programming language and object oriented systems.
Object Oriented System
Java.TM. is an object-oriented programming language. Object-oriented programming is a method of creating computer programs by combining certain fundamental building blocks, and creating relationships among and between the building blocks. The building blocks in object-oriented programming systems are called "objects." An object is a programming unit that groups together a data structure (instance variables) and the operations (methods) that can use or affect that data. Thus, an object consists of data and one or more operations or procedures that can be performed on that data. The joining of data and operations into a unitary building block is called "encapsulation".
An object can be instructed to perform one of its methods when it receives a "message." A message is a command or instruction to the object to execute a certain method. It consists of a method selection (name) and a plurality of arguments that are sent to an object. A message tells the receiving object what operations to perform.
One advantage of object-oriented programming is the way in which methods are invoked. When a message is sent to an object, it is not necessary for the message to instruct the object how to perform a certain method. It is only necessary to request that the object execute the method. This greatly simplifies program development.
Object-oriented programming languages are predominantly based on a "class" scheme. The class-based object-oriented programming scheme is generally described in Lieberman, "Using Prototypical Objects to Implement Shared Behavior in Object-Oriented Systems," OOPSLA 86 Proceedings, September 1986, pp. 214-223.
A class defines a type of object that typically includes both instance variables and methods for the class. An object class is used to create a particular instance of an object. An instance of an object class includes the variables and methods defined for the class. Multiple instances of the same class can be created from an object class. Each instance that is created from the object class is said to be of the same type or class.
A hierarchy of classes can be defined such that an object class definition has one or more subclasses. A subclass inherits its parent's (and grandparent's etc.) definition. Each subclass in the hierarchy may add to or modify the behavior specified by its parent class (also referred to as its superclass).
To illustrate, an employee object class can include "name" and "salary" instance variables and a "set_salary" method. Instances of the employee object class can be created, or instantiated for each employee in an organization. Each object instance is said to be of type "employee." Each employee object instance includes the "name" and "salary" instance variables and the "set_salary" method. The values associated with the "name" and "salary" variables in each employee object instance contain the name and salary of an employee in the organization. A message can be sent to an employee's employee object instance to invoke the "set_salary" method to modify the employee's salary (i.e., the value associated with the "salary" variable in the employee's employee object).
A developer may desire to have different implementations of a common method in each subclass. For example, suppose that a class A defines a method for printing the style of a font and that a class B defines a method for printing the point size of a font. Instead of providing for the same method in each class (with the only difference being the information that is printed), the Java.upsilon. programming language permits the developer to define an interface implemented by both class A and class B that prints information. A class definition of the interface accepts instances of class A or class B as arguments to produce the desired result. Consequently, each class declares to implement the interface and creates their own implementation of the method. At run time, reference to the commonly implemented method is resolved. An interface also provides the functions the developer must define in order for future developers and users to communicate with specific instances of an object.
An object is a generic term that is used in the object-oriented programming environment to refer to a module that contains related code and variables. A software program can be written using an object-oriented programming language whereby the program's functionality is implemented using objects.
The technology developed by Sun Microsystems provides for a platform independent method of using multiple font formats. The system provides a getFontList() method that provides the developer with a short list of logical font names that are mapped onto specific fonts available on specific platforms. In addition, the Font class provides for a setFont(Font font) method and a getFont() method. The setFont(Font font) method allows the developer to specify the current font and takes a font object as an argument (the font object argument is often constructed within the argument brackets; i.e., a "Font" function creates, initializes and returns a new font object with user specified parameters). The getFont() method returns the current font. This prior art Font class does not permit detailed retrieval of font specific information from one object. In addition, only the logical font names are retrieved by the getFontList() method. A logical font name is the name that is public and available for a developer's view and use. Each logical font name is mapped internally onto a specific font available on a specific platform. Further, font format specific information is not available and may not be stored in the object.
The lack of flexibility, inability to access multiple font specific features, and the inability to access font format specific features from one object in the prior art necessitates the need for the present invention.